Skip to content

[Tool] Add localization table normalization tool - #2488

Open
NORPG wants to merge 3 commits into
masterfrom
sort-tool
Open

[Tool] Add localization table normalization tool#2488
NORPG wants to merge 3 commits into
masterfrom
sort-tool

Conversation

@NORPG

@NORPG NORPG commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • add a Node.js tool that normalizes text, description, and lore localization tables into ATT's canonical locale order
  • add commented TODO placeholders for missing translations while keeping English-only tables compact
  • add a Visual Studio Code task that runs the tool against the active file
  • document the workflow, examples, safety precautions, and current limitations for contributors

User guide: .contrib/.tools/README.md

Why

Localization tables can contain inconsistent locale ordering and omit placeholders for untranslated values. This tool makes those tables easier to review and helps contributors see which translations are still missing.

This is a replacement for #2231 with the requested user guide and additional inline comments explaining the implementation.

Impact and limitations

The tool updates the selected file in place and is intentionally limited to simple, one-locale-per-line tables. Content that is not recognized as a locale assignment—including parser pragmas inside a matched table—is not retained, so contributors must review the complete Git diff after running it.

Validation

  • Ran the tool against a fixture containing out-of-order active and commented locales, then compared the complete output with the expected canonical order and TODO placeholders.
  • Confirmed that an English-only table remains unchanged without additional TODO placeholders.
  • Ran the tool a second time against the normalized fixture and confirmed that the output is idempotent.
  • Confirmed the script parses successfully with node --check .contrib/.tools/Lua/normalize.js.

@NORPG
NORPG marked this pull request as ready for review August 4, 2026 19:01
@NORPG

NORPG commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

The PR was generated using ChatGPT (Codex) and doesn't seem to have any major issues.
Feel free to add anything to this discussion thread if needed.

@NORPG NORPG self-assigned this Aug 6, 2026
@NORPG NORPG added the Suggestion New feature or request label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Suggestion New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant